<style>
#mp-list{font-size:16px;}
#mp-list tr{background-color:#FFF;margin:4px 0;}
#mp-list th{line-height:32px;text-align: center;}
#mp-list td{line-height:32px;vertical-align: middle;text-align: center;}
#mp-list td,#mp-list td a{color:#3C3431;}
#mp-list td{color:#323136;}
#mp-list .odd{background-color:#FFF0C5!important;}
#mp-list .left-size{}
#mp-list .right-size{display:none;}
.mpdiff{}
</style>
<div style="padding:10px;background-color:#fff;">
	
	<table id="mp-list" class="n-size-full">
		<tbody>
			<tr>
				
				<th width="60">排名</th>
				<th style="text-align: left;">公众号</th>
				<!--th>发布</th-->
				<th width="80" class="left-size">总阅读量</th>
				<th width="100" class="left-size">头条阅读量</th>
				<th width="100">平均阅读量</th>
				<th width="80" class="right-size">最高</th>
				<th width="100" class="right-size">总点赞数</th>
				<th width="80">
					<img id="to-lr" class="toright" src="/mprank/img/to-right.png" />
					中指数</th>
				<?php if ($data['needCart'] == 'Y'):?>
				<th width="60">
					对比
					</th>
				<th width="60">
					收藏
					</th>
				<?php endif;?>
			</tr>
		<?php $count = $data['startSeq']+1;?>
		<?php foreach ($data['rank_mplist'] as $mp):?>
			<tr>
				<td style="text-align: center;vertical-align: middle;">
					<?=$count?>
				</td>
				<td style="text-align: left;">
					<!--img style="float:left;width:60px;border-radius:50px;" src="/static/weixin_face/<?=$mp['wxid']?>.jpg" /-->
	
					<!--a style="margin-left:70px;display:block;margin-top:20px;" href="<?=n_url('weixin', 'detail', ['wxid'=>$mp['wxid']])?>" target="_blank"-->
					<a href="<?=n_url('weixin', 'detail', ['wxid'=>$mp['wxid']])?>" target="_blank">
						<?=$mp['wxname']?>
					</a>
				</td>
				<!--td><?=$mp['pub_times']?>/<?=$mp['pub_num']?></td-->
				<?php if(N_ACTION=="rankweekly"):?>
					<td class="left-size"><?=n_api('weixin')->numMore($mp['all_read_num_sum'])?></td>
				<?php else:?>
					<td class="left-size"><?=n_api('weixin')->numMore($mp['all_read_num'])?></td>
				<?php endif;?>
				<td class="left-size">
					<?=n_api('weixin')->numMore($mp['head_read_num'])?>
					</td>
				<td><?=n_api('weixin')->numMore($mp['average_read_num'])?></td>
				<td class="right-size"><?=n_api('weixin')->numMore($mp['max_read_num'])?></td>
				<td class="right-size"><?=$mp['all_like_num']?></td>
				<td><?=$mp['weixin_index']?></td>
				<?php if ($data['needCart'] == 'Y'):?>
				<td>
					<a class="mpdiff" href="javascript:void(0);" wxid="<?=$mp['wxid']?>" onclick="add('<?=$mp['wxid']?>','<?=get_weixin_face($mp['wxid'])?>','<?=$mp['wxname']?>')">
						<img src="<?=n_img('skin','diff.png')?>" />
					</a>
				</td>
				<td>
					<?php if (in_array($mp['wxid'], $data['cart'])):?>
						<a class="mpadd" href="javascript:void(0);" wxid="<?=$mp['wxid']?>">
							<img src="<?=n_img('skin','heat-on.png')?>" />
						</a>
					<?php else:?>
						<a class="mpadd add" href="javascript:void(0);" wxid="<?=$mp['wxid']?>">
							<img src="<?=n_img('skin','heat-off.png')?>" />
							</a>
					<?php endif;?>
					
				</td>
				<?php endif;?>
			</tr>
		<?php $count++; endforeach;?>
		</tbody>
	</table>
</div>
<script src="<?=n_js('weixin','cac')?>"></script>
<script>
$(document).ready(function(){
	var i = 0;
	$("#mp-list tr").each(function(){
		if(i==1){
			$(this).addClass('odd');
		}
		i = 1 - i;
	});
	
	
	
	/**
	var cookiefav = $.cookie('fav');
	if(!cookiefav){
		cookiefav = '';
	}
	var fav = cookiefav==''?[]:cookiefav.split('----');
	for(var i in fav){
		$(".mpadd[wxid="+fav[i]+"]").find("img").attr("src","/skin/img/fav-on.png");
	}
		
	$(".mpadd").click(function(){
		var wxid = $(this).attr('wxid');
		var cookiefav = $.cookie('fav');
		if(!cookiefav){
			cookiefav = '';
		}
		var fav = cookiefav==''?[]:cookiefav.split('----');
		var newfav = [];
		var onoff = 'on';
		var type = 'add';
		for(var i in fav){
			if(fav[i]==wxid){
				type = 'remove';
				onoff = 'off';
				continue;
			}
			newfav.push(fav[i]);
		}

		if(type=='add'){
			newfav.push(wxid);
		}

		$.cookie('fav',newfav.join('----'));
		$(this).find('img').attr('src','/skin/img/fav-'+onoff+'.png');
	});
	 */	
	
	
	$("#to-lr").click(function(){
		if($(this).hasClass('toright')){
			$('.left-size').hide();
			$('.right-size').show();
			$(this)
				.removeClass("toright")
				.addClass("toleft");
			$(this).attr('src','/mprank/img/to-left.png');
			
		}else{
			$('.left-size').show();
			$('.right-size').hide();

			$(this)
				.removeClass("toleft")
				.addClass("toright");
			$(this).attr('src','/mprank/img/to-right.png');
		}
	});

});




</script>

<div id="tips" style="width:480px;height:300px;border-radius: 5px;background-color:#34454D;display:none;position:absolute;text-align: center;">
	<div style="margin-top:88px;">
		<a class="n-btn-blue" href="/passport/login.html">请您登录</a>
	</div>
	<div style="margin-top:15px;">
		<a class="n-btn-blue" href="javascript:void(0);" onclick="tips.close();">返　回</a>
	</div>
</div>